#include "hdd.h"

ISR(SIG_INTERRUPT0){
  TCNT0=0xFc;
  timeDiv=0;
}


void init(void){
  DDRB=0xFF;  /*1=output; 0=input*/
  DDRC=0xFF;
  DDRD=0xFB;
  
  PORTB=0x00;
  PORTC=0x00;
  PORTD=0x04;
  
  OSCCAL=0xb4;
  
  timerInit();
  
  timeDiv=0;
  out=0x20;
  trigA=0;
  trigB=0;
  odo=0;
  digitA[0]=35;
  digitA[1]=50;
  digitA[2]=67;
  digitA[3]=84;
  digitA[4]=3;
  digitA[5]=20;
  
  digitB[0]=35;
  digitB[1]=45;
  digitB[2]=54;
  digitB[3]=64;
  digitB[4]=74;
  digitB[5]=84;
  digitB[6]=93;
  digitB[7]=6;
  digitB[8]=16;
  digitB[9]=25;
  
  sec=0;
  minA=5;
  minB=8;
  hrA=1;
  hrB=5;
  
  MCUCR|=0x0A;                //external interrupt on falling edge
  GICR|=_BV(INT0);  //enable external interrupt
  
  sei();
}

int main(void){

  init();
  
  while(1){

  }
}
